﻿var headerheight = 168;
var footerheight = 160;
var documentheight = function () {
    var body = document.body,
    html = document.documentElement;

    var height = Math.max(body.scrollHeight, body.offsetHeight,
                           html.clientHeight, html.scrollHeight, html.offsetHeight);

    return height;
}